home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
O Boy
/
Source
/
OBoy_hi.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-24
|
2KB
|
109 lines
#pragma once on
/*
OBoyHI.h
© Bob Boylan 1996
Revision History
MacHack 1996 Initial creation
*/
#include "AEObj_pd.h"
#include "PropertyValue_pd.h"
// -----------------------------------------------------------------
// the human interface of OBoy
//
class OBoy_hi
{
public:
// ctor
OBoy_hi();
// dtor
virtual ~OBoy_hi();
// output
void ReDraw();
void NewSubModel( Clone_ut< AEObj_pd > inAEobj );
void NewPropertyValue( Clone_ut< PropertyValue_pd > inPropertyValue );
static
void ShowAbout();
void AdjustToSize( Rect theOldRect, Rect theNewRect );
// input
void HandleClick(EventRecord * theEvent);
void HandleKeyDownEvent(EventRecord & theEvent);
// access
inline
ListHandle GetListH() { return _ListH; }
inline
WindowPtr GetWindowP() { return _WindowP; }
// statics
static Boolean _CancelWasIssued;
static RGBColor _BackGroundGray;
protected:
// class local enums
enum EHButton
{
AllButtons = 0xFFFF,
UpHButton = 0x0001,
DownHButton = 0x0002,
LeftHButton = 0x0004,
RightHButton = 0x0008,
NoHButton = 0x0010
};
// more input
// TrackButtonHit - for the 'a' and 'b' button
Boolean TrackButtonHit( Int_16 inButtonItem );
virtual
void HandleNavButton(EventRecord * inEventP, Point inLocalWhere);
// more output
// performing an update of the object data
void UpdateObjectData();
void UpdateName();
void UpdateProgress();
void DrawO( Int_32 inStage );
void DrawHierNavButton( EHButton inButtonToDraw = AllButtons, Boolean inHighlight = false );
// FindHButton ... within the nav button we need to know the direction
EHButton FindHButton( Point inLocation );
// the function that handles the navigation of the hierarchy
void NavigateHier( EHButton inDirection, EventRecord * inEventP );
// function to handle updates of size
void UpdateNavRegions();
private:
// data, lots of it
WindowPtr _WindowP;
ListHandle _ListH;
RgnHandle _UpNavButton;
RgnHandle _DownNavButton;
RgnHandle _LeftNavButton;
RgnHandle _RightNavButton;
Clone_ut<AEObj_pd> _Obj;
vector< Clone_ut<AEObj_pd> > _SubModels;
vector< Clone_ut<PropertyValue_pd> > _PropertyValues;
Int_32 _TimeOfLastProgressUpdate;
Int_32 _Progress;
Boolean _UpdateInProgress;
Int_32 _MaxItemsToShow;
};